home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / 4dview / 4dstuff.h < prev    next >
C/C++ Source or Header  |  1993-08-16  |  2KB  |  110 lines

  1. #include <math.h>
  2. extern "C" {
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <ctype.h>
  6. #include <string.h>
  7. }
  8.  
  9. class clip_plane
  10. {
  11.  public:
  12.  clip_plane();
  13.  double ax,by,cz,dw,e,depth;
  14. };
  15.  
  16. class vertex
  17. {
  18.  public:
  19.  vertex();
  20.  void read_vertex4d(int, FILE *, int);
  21.  void read_vertex(int, FILE *, int);
  22.  vertex *next;
  23.  double x,y,z,w;
  24.  double r,g,b,a;
  25.  int clip;
  26.  int num;
  27. };
  28.  
  29. class vertex_list
  30. {
  31.  public:
  32.  vertex_list();
  33.  void read_vertices(int, FILE *);
  34.  void write_vertices(FILE *);
  35.  void write_vertices3d(FILE *, float [4][4], clip_plane *);
  36.  void setproj(int);
  37.  void clip_vertex(double, double, double, double, double, int);
  38.  void put_in_array(vertex **);
  39.  vertex *add_vertex(double, double, double, double);
  40.  void refresh_vertex_list();
  41.  int numvtx;
  42.  double a,b,c,d,e;
  43.  int side;
  44.  int vtype;
  45.  int colorscheme;
  46.  int coloron;
  47.  
  48.  private:
  49.  vertex *head;
  50.  vertex *point;
  51.  int projection;
  52. };
  53.  
  54. class pvtx
  55. {
  56.  public:
  57.  pvtx();
  58.  void read_pvtx(FILE *);
  59.  int num;
  60.  vertex *me;
  61.  pvtx *next;
  62. };
  63.  
  64. class polyvtx_list
  65. {
  66.  public:
  67.  polyvtx_list();
  68.  void read_polyvtx(int, FILE *);
  69.  void write_polyvtx(FILE *);
  70.  int find_unclipped_vertex(vertex **);
  71.  int clip_each_vertex(vertex_list *, vertex **);
  72.  int numvtx;
  73.  
  74.  private:
  75.  pvtx *head;
  76.  pvtx *point;
  77. };
  78.  
  79.  
  80. class poly
  81. {
  82.  public:
  83.  poly();
  84.  void read_poly(FILE *);
  85.  void clip_poly(vertex_list * cli, vertex **);
  86.  int numvtx;
  87.  int clipped;
  88.  polyvtx_list *me;
  89.  poly *next;
  90. };
  91.  
  92. class poly_list
  93. {
  94.  public:
  95.  poly_list();
  96.  void read_polys(int, FILE *);
  97.  void write_polys(FILE *);
  98.  void clip_polys(vertex_list *);
  99.  void refresh_poly_list();
  100.  int numpoly;
  101.  
  102.  private:
  103.  poly *head;
  104.  poly *point;
  105. };
  106.  
  107. int load_off_file(poly_list *, vertex_list *, char *, char *);
  108. void err_msg(char *);
  109. void sliderval(float *, float *);
  110.